package fristphase.day9_06.ooday09;

public class MyStringTest {
    String[] strs = { "123abc","123abc","123abc","123" + "abc","123","abc"};
    public void myJudgeString(String a,String b ){
        System.out.println(a == b);
    }
    public void allValue(){
        for (int i = 0; i < strs.length; i++) {
            if (i == 0){
                System.out.print("str=");
            }else {
                System.out.print("str"+i+"=");
            }
            System.out.println(strs[i]);
        }
    }
    public static void main(String[] args) {
        MyStringTest o1 = new MyStringTest();
        System.out.println("所有数据：");
        o1.allValue();
        System.out.print("将str与str1对比：");
        o1.myJudgeString(o1.strs[0],o1.strs[1]);
        System.out.print("str2没改值前,str与str2对比：");
        o1.myJudgeString(o1.strs[0],o1.strs[2]);
        System.out.print("str2改值,str与str2对比：");
        o1.strs[2] = o1.strs[2]+"!";
        o1.myJudgeString(o1.strs[0],o1.strs[2]);
        System.out.print("将str与str3对比：");
        o1.myJudgeString(o1.strs[0],o1.strs[3]);
        System.out.print("将str与str6对比：");
        String str6 = o1.strs[4] +o1.strs[5];
        String str7 = "123";
        String str8 = "abc";
        String str9 = str7 + str8;
        o1.myJudgeString(o1.strs[0],str9);

    }
}
